package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.model.AddOrderModelImpl;
import com.sphd.beautysalon.view.AddOrderView;

/**
* Created by Hu on 2016/12/06
*/

public class AddOrderPresenterImpl implements AddOrderPresenter {
    AddOrderModelImpl addOrderModel;
    AddOrderView addOrderView;

    public AddOrderPresenterImpl(AddOrderView addOrderView) {
        this.addOrderView = addOrderView;
        addOrderModel=new AddOrderModelImpl();
    }

    @Override
    public void addData(String url) {
        addOrderView.showLoading();
        addOrderModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
        addOrderView.dissLoading();
    }

    @Override
    public void recRes(int res) {
        if (res==1){
            addOrderView.recOk();
        }else {
            addOrderView.recFaile();
        }
        addOrderView.dissLoading();
    }
}